package com.weiz.designpatterns.composite;

import java.util.List;
/**
 * 公司类
 * @author weiz
 */
public class Company extends Basic {
    /**
     * 包含的部门
     */
    private List<Basic> list;
    @Override
    int getSumOfStaff(int sum) {
        for(Basic basic:list){
            sum=basic.getSumOfStaff(sum);
        }
        return sum;
    }
    public List<Basic> getList() {
        return list;
    }
    public void setList(List<Basic> list) {
        this.list = list;
    }
}